﻿<div class="blade-content __medium-wide">
	<div class="blade-inner">
		<div class="inner-block">
			<fieldset>
				<legend class="ng-binding">Chosen placeholders</legend>
				<div class="form-group">
					<a class="clear text-mini __link" ng-click="blade.deleteAllPlaceholder()" ng-if="blade.entity.contentPlaces.length > 0">Clear all</a>
					<ul class="list __inline __chosen">
						<li class="list-item" ng-repeat="place in blade.entity.contentPlaces">
							<a class="list-remove" ng-click="blade.deletePlaceholder(place)">×</a>
							<span class="list-name">{{place.path}}\{{place.name}}</span>
						</li>
					</ul>
				</div>
			</fieldset>
			<fieldset>
				<legend class="ng-binding">Content placeholders</legend>
				<va-breadcrumb ng-model="blade.breadcrumbs" blade-id="blade.id"></va-breadcrumb>

				<div class="table-wrapper">
					<table class="table" ng-if="blade.currentEntity && (blade.currentEntity.childrenFolders.length > 0 || blade.currentEntity.placeholders.length > 0)">
						<thead>
							<tr>
								<th class="table-col">Pic</th>
								<th class="table-col">Name</th>
								<th class="table-col">Description</th>
							</tr>
						</thead>
						<tbody>
							<tr class="table-item" ng-repeat="data in blade.currentEntity.childrenFolders" ng-click="blade.folderClick(data)">
								<td class="table-col __product-img">
									<div class="product-img">
										<i class="table-ico fa fa-folder"></i>
									</div>
								</td>
								<td class="table-col __product-name">
									{{data.name}}
								</td>
								<td class="table-col">
									{{data.description}}
								</td>
							</tr>
							<tr class="table-item" ng-repeat="placeholder in blade.currentEntity.placeholders" ng-click="blade.addPlaceholder(placeholder)" ng-if="blade.checkPlaceholder(placeholder)">
								<td class="table-col __product-img">
									<div class="product-img">
										<i class="table-ico fa fa-location-arrow"></i>
									</div>
								</td>
								<td class="table-col __product-name">
									{{placeholder.name}}
								</td>
								<td class="table-col">
									{{placeholder.description}}
								</td>
							</tr>
						</tbody>
					</table>
				</div>
				<div class="note" ng-if="(blade.currentEntity.childrenFolders.length === 0 && blade.currentEntity.placeholders.length === 0)">
					No data
				</div>
			</fieldset>
		</div>
	</div>
</div>